import {
	defineStore
} from 'pinia';
// 定义字典 store
export const dictDataStore = defineStore('dict', {
	state: () => ({
		// 存储字典数据
		dict: {}
	}),
	actions: {
		/**
		 * 设置指定类型的字典数据
		 */
		setDictData(type, data) {
			this.dict[type] = data;
		},
		getDictByType(type) {
			console.log(this.dict, '原始数据')
			return this.dict[type] ? JSON.parse(JSON.stringify(this.dict[type])) : [];
		}
	}

});
//字典的key列表
export const dictKeys = [ 'sys_devMode_1', 'sys_devMode_2', 'sys_devMode_3',
	'sys_devchild_lock', 'sys_switch_status', 'sys_networking_status','sys_gwSF','sys_heating_type','sys_sub_dev_type','sys_devKey_lock'
];